package com.yingyi.system.mapper;

import com.yingyi.basic.mapper.BaseMapper;
import com.yingyi.system.domain.Menu;
import com.yingyi.system.domain.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * (t_role)表数据库访问层
 *
 * @author Yingyi
 * @since 2022-08-02 10:39:24
 */
public interface RoleMapper extends BaseMapper<Role>{


    /**
     * 使用@Param(value = "xx")注解给参数取一个别名，用于在xml中使用foreach遍历时取值
     * @param id
     * @param menuId
     */
    void insertRoleMenu(@Param(value = "rid") Long id, @Param(value = "menuId") List<Long> menuId);

    void insertRolePermission(@Param(value = "rid") Long id, @Param(value = "permissionId") List<Long> permissionId);

    void deleteEmployeeRole(Long id);

    void deleteRolePermission(Long id);

    void deleteRoleMenu(Long id);

    List<Menu> queryRoleMenuByRoleId(Long rid);
}
